import React, { Component, Fragment } from 'react';
import Swiper from 'react-native-swiper'; // 轮播组件
import { Image, StyleSheet } from 'react-native';

export default class LoopSwiper extends Component {
  render() {
    return (
      <Swiper
        autoplay
        paginationStyle={styles.dotStyle}
      >
        <Image style={styles.loopImg} source={{ uri: 'https://cs-static-assets.oss-cn-beijing.aliyuncs.com/react-native/2.jpg' }} />
        <Image style={styles.loopImg} source={{ uri: 'https://cs-static-assets.oss-cn-beijing.aliyuncs.com/react-native/1.jpg' }} />
        <Image style={styles.loopImg} source={{ uri: 'https://cs-static-assets.oss-cn-beijing.aliyuncs.com/react-native/3.jpg' }} />
        <Image style={styles.loopImg} source={{ uri: 'https://cs-static-assets.oss-cn-beijing.aliyuncs.com/react-native/4.jpg' }} />
      </Swiper>
    )
  }
}

const styles = StyleSheet.create({
  loopImg: {
    width: '100%',
    height: '100%'
  },
  dotStyle: {
    // dot的样式
    bottom: 10
  }
})
